import requestNoAuth from '@/utils/requestNoAuth'

// export function getFeaturedGoods() {
//   return requestNoAuth({
//     url: '/goods/getFeaturedGoods',
//     method: 'get'
//   })
// }

// export function sayHi() {
//   return requestNoAuth.get('/goods/sayhi') // 自动只返回 Hello World!
// }

// export function getGoodsList() {
//   return requestNoAuth({
//     url: '/goods/getGoodsList',
//     method: 'get'
//   })
// }

export function sayHi() {
  return 'hello world'
}

// src/api/product.js
export function getFeaturedGoods() {
  return new Promise(resolve => {
    setTimeout(() => {
      resolve({
        data: [
          {
            id: 1,
            name: '玉米酒',
            price: 199,
            origin: '玉米',
            year: 2016,
            description: '这是一款由优质玉米酿造的传统酒，口感醇厚，回味悠长。',
            image: '/yumijiu.png'
          },
          {
            id: 2,
            name: '纯白酒',
            price: 299,
            origin: '稻谷',
            year: 2020,
            description: '这是一款采用优质稻谷酿造的白酒，清香扑鼻，适合各种场合。',
            image: '/chunbaijiu.png'
          },
          {
            id: 3,
            name: '高粱酒',
            price: 399,
            origin: '高粱',
            year: 2019,
            description: '这是一款由高粱酿造的传统酒，口感独特，适合搭配各种美食。',
            image: '/gaoliang.png'
          }
        ]
      })
    }, 300) // 模拟网络延迟 300ms
  })
}

// 获取商品列表（模拟数据）
export function getGoodsList() {
  return new Promise(resolve => {
    setTimeout(() => {
      resolve({
        data: [
          {
            id: 1,
            name: '玉米酒',
            price: 199,
            origin: '玉米',
            year: 2016,
            alcohol: 42,
            description: '这是一款由优质玉米酿造的传统酒，口感醇厚，回味悠长。',
            image: '/yumijiu.png'
          },
          {
            id: 2,
            name: '纯白酒',
            price: 299,
            origin: '稻谷',
            year: 2020,
            alcohol: 50,
            description: '这是一款采用优质稻谷酿造的白酒，清香扑鼻，适合各种场合。',
            image: '/chunbaijiu.png'
          },
          {
            id: 3,
            name: '高粱酒',
            price: 399,
            origin: '高粱',
            year: 2019,
            alcohol: 48,
            description: '这是一款由高粱酿造的传统酒，口感独特，适合搭配各种美食。',
            image: '/gaoliang.png'
          },
          {
            id: 4,
            name: '金樱子酒',
            price: 499,
            origin: '金樱子',
            year: 2019,
            alcohol: 38,
            description: '这是一款由金樱子酿造的传统酒，口感独特，适合搭配各种美食。',
            image: '/jinyingzi.png'
          },
          {
            id: 5,
            name: '糯米酒',
            price: 599,
            origin: '糯米',
            year: 2018,
            alcohol: 35,
            description: '采用传统工艺酿造的糯米酒，香甜醇厚，适合佐餐饮用。',
            image: '/nuomijiu.png'
          },
          {
            id: 6,
            name: '荞麦酒',
            price: 699,
            origin: '荞麦',
            year: 2021,
            alcohol: 40,
            description: '精选荞麦酿造，风味独特，富含营养，适合养生人士。',
            image: '/qiaomai.png'
          },
          {
            id: 7,
            name: '山楂酒',
            price: 799,
            origin: '山楂',
            year: 2022,
            alcohol: 33,
            description: '山楂酿制而成，酸甜可口，适合女性饮用。',
            image: '/shanzha.png'
          },
          {
            id: 8,
            name: '红枣酒',
            price: 899,
            origin: '红枣',
            year: 2021,
            alcohol: 36,
            description: '红枣酿造，滋补养颜，口感顺滑，香气浓郁。',
            image: '/hongzao.png'
          },
          {
            id: 9,
            name: '梅子酒',
            price: 999,
            origin: '青梅',
            year: 2023,
            alcohol: 30,
            description: '清新淡雅的青梅酒，酸中带甜，适合夏日饮用。',
            image: '/meizi.png'
          }
        ]
      })
    }, 300)
  })
}
